package com.baihui.taobao.action;

import com.baihui.taobao.db.TPSessionDAO;
import com.opensymphony.xwork2.ActionSupport;

public class CommitCrmApiKeyAction extends ActionSupport {

	private static final long serialVersionUID = 7803674731599166199L;
	public String baihuiId;
	public String crmApiKey;;

	public String getCrmApiKey() {
		return crmApiKey;
	}

	public void setCrmApiKey(String crmApiKey) {
		this.crmApiKey = crmApiKey;
	}

	public String getBaihuiId() {
		return baihuiId;
	}

	public void setBaihuiId(String baihuiId) {
		this.baihuiId = baihuiId;
	}

	@Override
	public String execute() throws Exception {

		TPSessionDAO userDAO = new TPSessionDAO();
		userDAO.updateAndInsert(
				"update topsession set crmapikey = ? where baihuiuser= ?",
				new Object[] { crmApiKey, baihuiId });
		return NONE;
	}
}
